package com.itheima.utils;

/**
 * 多种加密方式
 *
 * @create 2020/12/2 0002 9:56
 */
public class PasswordTest {
    /**
     * AES密钥
     */
    private static final String AESKEY = "123@abc!";
    /**
     * DES密钥
     */
    private final static String DESKEY = "!cbc@321";
    static String password = "123456";
    
    public static void main(String[] args) {
        System.out.println("初始密码: " + password);
        EncryptUtil encryptUtil = EncryptUtil.getInstance();
        System.out.println("AES加密: " + encryptUtil.AESencode(password, AESKEY));
        System.out.println("AES解密: " + encryptUtil.AESdecode(encryptUtil.AESencode(password, AESKEY), AESKEY));
        System.out.println("DES加密: " + encryptUtil.DESencode(password, DESKEY));
        System.out.println("DES解密: " + encryptUtil.DESdecode(encryptUtil.DESencode(password, DESKEY), DESKEY));
        System.out.println("Base64加密: " + encryptUtil.Base64Encode(password));
        System.out.println("Base64解密: " + encryptUtil.Base64Decode(encryptUtil.Base64Encode(password)));
        System.out.println("MD5加密: " + encryptUtil.MD5(password));
        System.out.println("SHA1加密: " + encryptUtil.SHA1(password));
        System.out.println("BCrypt加密: " + encryptUtil.BCrypt(password));
    }
}

